package com.woniu.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniu.entity.ServiceRecordEn;
import com.woniu.pojo.ServiceRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.vo.ServiceRecordVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author rsw
 * @since 2022-10-18
 */
public interface ServiceRecordMapper extends BaseMapper<ServiceRecord> {



    /*@Select("select user.id id ,user.name name,user.code code ,\n" +
            "user.phone phone , user.package_id package_id,\n" +
            "services.item_id item_id, services.doctor_id doctor_id,\n" +
            "services.service_status_id service_status_id,\n" +
            "services.appointment_time appointment_time,user.image image\n" +
            "\n" +
            "from tb_user user,tb_package package,tb_service_record record,tb_services services\n" +
            "where user.id = services.user_id "
    )*/


//    @Select("<script>"+
//            "select user.id id ,user.name name,user.code code ,\n" +
//            "user.phone phone , user.package_id package_id,\n" +
//            "services.item_id item_id, services.doctor_id doctor_id,\n" +
//            "services.service_status_id service_status_id,\n" +
//            "services.appointment_time appointment_time,user.image image\n" +
//            "from tb_user user,tb_package package,tb_service_record record,tb_services services\n"
//            + "<where>                                             "
//            + "  <if test='serviceRecordVo.serviceStatusId!= null'>     "
//            + " and service_status_id = #{serviceRecordVo.serviceStatusId}                                "
//            + "  </if>                                             "
//            + "  <if test='serviceRecordVo.packageId!= null'>     "
//            + " and package_id = #{serviceRecordVo.packageId}                                "
//            + "  </if> "
//            + "  <if test='serviceRecordVo.startTime!= null'>     "
//            + " and appointment_time < #{serviceRecordVo.startTime}                                "
//            + "  </if> "
//            + "  <if test='serviceRecordVo.endTime!= null'>     "
//            + " and appointment_time > #{serviceRecordVo.endTime}                                "
//            + "  </if> "
//            + "  <if test='serviceRecordVo.name!= null'>     "
//            + " and name like #{serviceRecordVo.name}                                "
//            + "  </if> "
//            + "</where>                                            "
//            + "</script>                                           ")
//    @Results( value={
//            @Result(property="serviceStatusId",   column="service_status_id"),
//            @Result(property="serviceStatusId",   column="service_status_id"),
//            @Result(property="packageId", column="package_id"),
//            @Result(property="age",  column="t_age"),
//    })




@Result(javaType = ServiceRecordEn.class)
    IPage<ServiceRecordEn> selectPageRecord(Page<ServiceRecordEn> recordPage,@Param("serviceRecordVo") ServiceRecordVo serviceRecordVo);
}
